package com.zhuiyun.pm.client.fb.mapper;

import com.zhuiyun.pm.client.fb.entity.ClientGoodInfo;
import com.zhuiyun.pm.config.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 *  发布mapper层
 * @author 温
 * @date 2023/3/14 16:55
 * @parameter
 * @return
 */
public interface PublishMapper extends BaseMapper<ClientGoodInfo> {


    @Select("SELECT *\n" +
            "FROM client_goods_info\n" +
            "WHERE goods_name like '%${goodName}%'\n" +
            "ORDER BY start_price DESC;")
    @Results({
            @Result(property = "imgId" , column = "img_id"),
            @Result(property = "startPrice" , column = "start_price"),
            @Result(property = "goodsName" , column = "goods_name"),
            @Result(property = "goodsNumber" , column = "goods_number")
    })
    List<ClientGoodInfo> clientPrice(@Param("goodName") String goodName,@Param("startPrice") String startPrice);



    @Select("SELECT *\n" +
            "FROM client_goods_info\n" +
            "WHERE goods_name like '%${goodName}%'\n" +
            "ORDER BY start_price asc;")
    @Results({
            @Result(property = "imgId" , column = "img_id"),
            @Result(property = "startPrice" , column = "start_price"),
            @Result(property = "goodsName" , column = "goods_name"),
            @Result(property = "goodsNumber" , column = "goods_number")
    })
    List<ClientGoodInfo> clientPrices(@Param("goodName") String goodName,@Param("startPrice") String startPrice);
}
